import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
import { RouterModule } from "@angular/router";
import { CommonModule } from '@angular/common';
import {AvCeilModule} from "./pipe/av-ceil/av-ceil.module";
import {AvNumberStringModule} from "./pipe/av-number-string/av-number-string.module";
import { CdkTableModule } from "@angular/cdk/table";
// Ng-zorro components


// My components
import { SpinComponent } from './components/spin/spin.component';
import { SimpleTableComponent } from './components/simple-table/simple-table.component';
import { AvPaginationComponent } from "./components/av-pagination/av-pagination.component";
import { SColorDirective } from './directive/s-color.directive';
import { TbFixedDirective } from './directive/tb-fixed.directive';
import { thAddonComponent } from "./components/simple-table/th-addon.component";
import { JspanelxComponent } from './components/jspanelx/jspanelx.component';
import { ConfirmModalComponent } from './components/jspanelx/confirm-modal/confirm-modal.component';
import { CompDiComponent } from './components/comp-di/comp-di.component';
import { CompDiChildComponent } from './components/comp-di-child/comp-di-child.component';
import { AvtSortDirective } from './components/simple-table/avt-sort.directive';

import { NzPaginationModule } from "ng-zorro-antd/pagination";


const My_DIRECTIVES: any[] = [
  SColorDirective,
  TbFixedDirective,
  AvtSortDirective
]

const Nz_Components: any[] = [
  NzPaginationModule
]

// 自己的组件
const MY_COMPONENTS: any[] | undefined = [
  SpinComponent,
  SimpleTableComponent,
  AvPaginationComponent,
  thAddonComponent,
  JspanelxComponent,
]


@NgModule({
  declarations: [
    ...MY_COMPONENTS,
    ...My_DIRECTIVES,
    TbFixedDirective,
    ConfirmModalComponent,
    CompDiComponent,
    CompDiChildComponent,
    AvtSortDirective,
  ],
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    AvCeilModule,
    AvNumberStringModule,
    CdkTableModule,
    ...Nz_Components
  ],
    exports: [
        ...MY_COMPONENTS,
        ...My_DIRECTIVES,
        FormsModule,
        ReactiveFormsModule,
        RouterModule,
        AvCeilModule,
        AvNumberStringModule,
        ...Nz_Components,
        ConfirmModalComponent,
        CompDiComponent,
      CdkTableModule
    ]
})
export class SharedModule { }
